import java.util.Scanner;

public class towork3 {
    public static void main(String[] args) {
        Scanner s=new Scanner(System.in);
        int n=s.nextInt();
        int temp=1000000;
        while(n!=0){
            int sum=s.nextInt();
            if(sum%2==0){
                temp=Math.min(temp,sum);
            }
            n--;
        }
        System.out.println(temp);
    }
}
